package cn.webrx;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class List6 {
    public static void main(String[] args) {
        //数组转换list
        Integer[] a = {1,2,3};
        System.out.println(new ArrayList<Integer>(Arrays.asList(a)));

        int[] b = {1,2,3};
        List<Integer> ccc = new ArrayList<>(b.length);
        for(int t : b){
            ccc.add(t);
        }
        System.out.println(ccc);

        //定义List
        List<Integer> list = Arrays.asList(1,2,3);
        System.out.println(list);

        System.out.println("-------------------------------");
        //list -> 数组
        System.out.println(Arrays.toString(ccc.toArray()));
    }
}
